<?php

/**
 * pagecomment filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasepagecommentFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ClassName'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'PageComment' => 'PageComment'))),
      'Created'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'LastEdited'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'Name'            => new sfWidgetFormFilterInput(),
      'Comment'         => new sfWidgetFormFilterInput(),
      'IsSpam'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'NeedsModeration' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'CommenterURL'    => new sfWidgetFormFilterInput(),
      'SessionID'       => new sfWidgetFormFilterInput(),
      'ParentID'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'AuthorID'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'ClassName'       => new sfValidatorChoice(array('required' => false, 'choices' => array('PageComment' => 'PageComment'))),
      'Created'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'LastEdited'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'Name'            => new sfValidatorPass(array('required' => false)),
      'Comment'         => new sfValidatorPass(array('required' => false)),
      'IsSpam'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'NeedsModeration' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'CommenterURL'    => new sfValidatorPass(array('required' => false)),
      'SessionID'       => new sfValidatorPass(array('required' => false)),
      'ParentID'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'AuthorID'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('pagecomment_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'pagecomment';
  }

  public function getFields()
  {
    return array(
      'ID'              => 'Number',
      'ClassName'       => 'Enum',
      'Created'         => 'Date',
      'LastEdited'      => 'Date',
      'Name'            => 'Text',
      'Comment'         => 'Text',
      'IsSpam'          => 'Number',
      'NeedsModeration' => 'Number',
      'CommenterURL'    => 'Text',
      'SessionID'       => 'Text',
      'ParentID'        => 'Number',
      'AuthorID'        => 'Number',
    );
  }
}
